@charset "UTF-8";

@import "lib/global";

/* Menus */

$menu-radius-px: 4px;

.pui-menu {
    margin: 0 0 1.5rem 0;
    padding: 0;
    list-style: none;
    position: relative;
    -webkit-user-select: none;
    -webkit-touch-callout: none;

    & > li {
        position: relative;
        
        & > a {
            display: block;
            padding: 7px 15px;
            //padding: 0.7rem 1.5rem;
            margin-bottom: 0.2rem;
            @include transition(all 0.2s ease-out);
            
            &.active, &.pui-active {
                background: $primary-color;
                color:#fff; 
                
                html.no-touch &:hover, &.hover {
                    background: darken($primary-color, 5%);
                }
            }
            
            html.no-touch &:hover, &.hover {
                background: #f6f6f6;
            }
            
            & > [class*=icon-], & > [class*=fa-], & > [class*=pui-icon-] {
                font-size: 1.6rem; 
                margin-right: 0.5rem;
            }

            & > .pui-badge {
                padding-top: 0;
                padding-bottom: 0;
                margin-left: 0.5rem;
                margin-top: 0;
                min-width: 1.6rem;
                line-height: 1.6rem;
                font-size: 1rem;
                float: right;
            }
        }
        
        
        &.pui-menu-header-small, &.pui-menu-header {
            padding: 0;
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        
        &.pui-menu-header-small { 
            font-weight: normal;
            color: #ccc; 
        }
        
        &.pui-menu-header-frame {
            padding-left: 1.2rem;
            border-left: 3px solid $primary-color;
        }
        
        &.pui-menu-divider {
            margin: 1.2rem 0;
            border-bottom: 1px solid #ddd;
        }
    
        &.pui-menu-foot {
            margin: 1.2rem 0;
        }

        & > .pui-badge-dot {
            position: absolute;
            top: 35%;
            right: 1.5rem;
        }
    }
        
    .disabled, .pui-disabled {
        color: #ccc;
    }
}

.pui-menu-small {
    > li {
        > a {
            padding: 5px 12px;
        }
    }
}

.pui-menu-radius > li > a {
    border-radius: $menu-radius-px;
}

.pui-menu-round > li > a {
    border-radius: 500px;
}

.pui-menu-radius-top > li > a {
    border-radius: 0;
    border-top-left-radius: $menu-radius-px;
    border-top-right-radius: $menu-radius-px;
}

.pui-menu-radius-bottom > li > a {
    border-radius: 0;
    border-bottom-right-radius: $menu-radius-px;
    border-bottom-right-radius: $menu-radius-px;
}

.pui-menu-radius-left > li > a {
    border-radius: 0;
    border-top-left-radius: $menu-radius-px;
    border-bottom-left-radius: $menu-radius-px;
}

.pui-menu-radius-right > li > a {
    border-radius: 0;
    border-top-right-radius: $menu-radius-px;
    border-bottom-right-radius: $menu-radius-px;
}

.pui-menu-link-color > li > a {
    color: $primary-color;
}

.pui-menu-active-underline {
    border-bottom: 2px solid #ddd;

    & > li {
        margin-bottom: -4px;

        & > a {
            padding-bottom: 7px;

            &.active {
                color: $primary-color;
                background: none;
                border-bottom: 2px solid $primary-color;

                html.no-touch &:hover, &.hover {
                    background: #f6f6f6;
                }
            }
        }
    }
}

.pui-menu-inline {
    & > li {
        display: inline-block;
        
        &.pui-menu-header {
            margin-right: 1.5rem;
        }
        
        &.pui-menu-divider { 
            text-indent: -9999px;
            text-indent: -9999rem;
            margin: 0 1.2rem;
            border: none;
            border-left: 1px solid #ddd;
        }

        & > .pui-badge-dot + a {
            padding-right: 30px;
        }
    }
}

.pui-menu-simple {
    & > li > a {
        padding: 1px 0;
        
        html.no-touch &:hover, &.hover {
            background: #fff;
        }
    }
    
    &.pui-menu-inline {
        margin-left: -5px;
        
        & > li > a {
            padding: 0 5px;
        }
    }
}

.pui-menu-tab-style {
    border-right: 1px solid #ddd;

    & > li > a {
        @include border-top-right-radius(0);
        @include border-bottom-right-radius(0);   

        &.active, &.pui-active {
            margin-right: -1px;
            background: none;
            color:inherit;
            border: 1px solid #ddd;
            border-right:1px solid #fff; 
            @include border-top-right-radius(0);
            @include border-bottom-right-radius(0);  
            
            html.no-touch &:hover, &.hover {
                color: $primary-color;
                background: none;
            }
        }            
    }

    &.pui-menu-inline {   
        border: none;
        border-bottom: 1px solid #ddd;

        & > li {
            margin-bottom: -3px;

            & + li {
                margin-right: 4px;
            }

            & > a {
                padding-bottom: 7px;
                @include border-radius($menu-radius-px);
                @include border-bottom-left-radius(0);
                @include border-bottom-right-radius(0);   

                &.active {  
                    border-right: 1px solid #ddd;
                    border-bottom: 1px solid #fff;
                }
            }
        }
    }
}

.pui-menu-justify {
    width: 100%;
    display: table;

    & > li {
        text-align: center;
        display: table-cell;  
    } 

    &.pui-menu-tab-style {
        border: none;
        border-bottom: 1px solid #ddd;

        & > li > a {
            margin-bottom: -1px;
            @include border-radius($menu-radius-px);
            @include border-bottom-left-radius(0);
            @include border-bottom-right-radius(0);   
            
            &.active, &.pui-active {  
                border-right: 1px solid #ddd;
                border-bottom: 1px solid #fff;
            }
        }

        & > li + li > a {
            margin-left: 2px;
        } 
    } 
}

@media only screen and (max-width: 640px) {
    .pui-menu-justify > li {
        display: block; 
    }
}

/* Menu dropdown */

.pui-menu-dropdown {
    position: absolute;
    top: 37px;
    left: 0;
    z-index: 999;
    border: 1px solid #ddd;
    @include border-radius($menu-radius-px);
    background: #fff;
    display: none;
    @include animation(menu-dropdown-slide-down 0.3s ease-in);
    @include animation-direction(reverse);

    & > li {
        text-align: left;

        &.pui-menu-header {
            padding: 5px 15px 0 15px;
            font-weight: normal;
            font-size: 12px;
            color: #ccc;
        }

        &:last-child {
            margin-bottom: 10px;
        }
        
        & > .pui-menu-dropdown {
            top: -4px;
            left: 92%;
        }
    }

    &:before, &:after {
        pointer-events: pointer-events;
        position: absolute;
        left: 15px;
        top: -8px;
        display: block;
        content: "";
        width: 0;
        height: 0;
        border: 8px solid transparent;
        border-width: 0 8px 8px; 
        z-index: 10; 
    }

    &:before { 
        border-bottom-color: #ccc;   
    }

    &:after { 
        border-bottom-color: #ffffff;  
        top: -7px;
    }

    & > li > &:before,
    & > li > &:after {
        border: 8px solid transparent; 
        border-right: 8px solid #ccc;
        border-left: 0;
        left: -8px;
        top: 10px;
    }

    & > li > &:after {
        border-right-color: #fff; 
        left: -7px;
    }
}

@include keyframes(menu-dropdown-slide-down) {
    0% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        -webkit-transform: translateY(-10%);
        transform: translateY(-10%);
    }
}

.pui-menu > li > .pui-menu-dropdown {
    display: none;
}

//.pui-menu > li.hover > .pui-menu-dropdown,
html.no-touch .pui-menu > li:hover > .pui-menu-dropdown {
    display: block;
}

.has-submenu:after { 
    position: absolute;
    right: 10px; 
    top: -1px; 
    font-family: "FontAwesome";
    font-weight: normal;
    font-style: normal; 
    font-size: 1.8rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: "\f105";
    color: #cccccc;
}  
    
.pui-menu-bordered-radius > li {
    &:first-child a {
        @include border-top-left-radius($menu-radius-px);
        @include border-top-right-radius($menu-radius-px);
    }
    
    &:last-child a {
        @include border-bottom-left-radius($menu-radius-px);
        @include border-bottom-right-radius($menu-radius-px);
    }
}

.pui-menu-bordered {
    & > li > a {
        border: 1px solid #ddd;
        margin: 0;
        margin-bottom: -1px;
        
        &.active, &.pui-active {
            border-color: $primary-color;
        }
    }

    &.pui-menu-inline > li {
        float:left;
        & > a {
            margin: 0;
            @include border-radius(0);
        }
        
        & + li {
            margin-left: -1px;
        }
    }
    
    &.pui-menu-inline.pui-menu-bordered-radius > li {
        &:first-child a {
            @include border-top-left-radius($menu-radius-px);
            @include border-bottom-left-radius($menu-radius-px);
        }
        
        &:last-child a {
            @include border-top-right-radius($menu-radius-px);
            @include border-bottom-right-radius($menu-radius-px);
        }
    }
}

.pui-menu-justify.pui-menu-bordered > li > a {
    @include border-radius(0);
}

.pui-menu-justify.pui-menu-bordered > li + li > a {
    border-left: none;
}

.pui-menubar { 
    width: 100%; 
    display: table;
    padding: 2px 10px;
    margin-bottom: 15px; 
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    vertical-align: middle;
    @include border-radius($menu-radius-px);
    
    @include clearfix();
    
    .pui-menu {
        padding: 2px 0 0;
        margin: 0;
        display: table-cell;
        vertical-align: middle;
    }
    
    input {
        margin: 1px 0 0 0;
    }
    
    .pui-btn-dropdown {
        margin: 0;
        padding-top:-5px;
    }
}

.pui-menubar-header-style {
    padding: 6px 10px;
    padding: 0.5rem 1rem;
} 

.pui-menubar-square {
    @include border-radius(0);
}

.pui-menubar-aside {
    text-align: left;
    vertical-align: middle;
    display: table-cell; 
}

.pui-menubar-middle { 
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}

.pui-menubar-offside { 
    display: table-cell; 
    text-align: right;
    vertical-align: middle;
}

.pui-menubar-top-fixed, .pui-menubar-bottom-fixed {
    position: fixed;
    left: 0;
    z-index: 1000;
    margin: 0;
    border: 0;
}

.pui-menubar-top-fixed {
    top: 0;
    border-bottom: 1px solid #ddd;
}

.pui-menubar-bottom-fixed {
    bottom: 0;
    border-top: 1px solid #ddd;
}


.pui-menu-dropdown-unarrow {
    &:before, &:after {
        border: none;
    }
} 
    
.pui-menu-dropdown.pui-menu-dropdown-unarrow {
    .pui-menu-dropdown {
        top: 0;
        left: 100%;
    }

    & > li .pui-menu-dropdown:before, & > li .pui-menu-dropdown:after {
        border: none;
    }
}

.pui-menu-dropdown-left-top {  
    top: 0;
    left: auto;
    right: 100%;
} 

.pui-menu-dropdown-left-bottom {  
    top: auto;
    left: auto;
    right: 100%;
    bottom: -19px;
} 

.pui-menu-dropdown-right-top {  
    top: 0;
    left: 100%;
    right: auto;
} 

.pui-menu-dropdown-right-bottom {  
    top: auto;
    left: 100%;
    right: auto;
    bottom: -19px;
}                 

.pui-menu-dropdown-bottom-right {  
    top: 35px;
    left: auto;
    right: 0;
}

.pui-menu-dropdown-top-left {  
    top: auto;
    left: 0;
    right: auto;
    bottom: 20px;
}

.pui-menu-dropdown-top-right {  
    top: auto;
    left: auto;
    right: 0;
    bottom: 20px;
}

.pui-menu-column {
    width: 100%;
    display: table;
    
    @include clearfix();

    > .pui-menu {
        display: table-cell;
    }
}

.pui-menubar {
    &[class*=pui-bg-] > .pui-menu > li, &[class*=pui-bg-] > .pui-menu > li > a {
        color: #fff;                    
    }

    &[class*=pui-bg-] > .pui-menu {

        > li {
            > a {
                margin: 0;
                padding: 10px 16px;
                border-radius: 0;

                &.active, &.pui-active {
                    background-color: rgba(0, 0, 0, 0.2);   
                }

                html.no-touch &:hover, &.hover {
                    background-color: rgba(0, 0, 0, 0.1);   
                }
            }
        }
        
        > li + li {
            margin-left: -3px;
        }
    }
}

.pui-menubar-bg-color {
    padding: 0 10px 0 0;
    border: none;

    > .pui-menu {
        padding: 0;
    }
}

@media only screen and (max-width: 480px) {
    .pui-menu-inline > li {
        display: block;
    }

    .pui-menu > li > .pui-menu-dropdown {
        width: 100%;
    }
}
